package nicg.st.service.evaldataenterservice;

import java.io.File;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Stack;

import javax.annotation.Resource;

import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.springframework.stereotype.Service;

import nicg.st.dao.EvalDataEnterMapper;
import nicg.st.entity.Divate;
import nicg.st.entity.EvalDataEnterVO;
import nicg.st.entity.EvalParams;
import nicg.st.entity.EvalResult;
import nicg.st.entity.IndicatorDataDetail;
import nicg.st.entity.IndicatorSys;
import nicg.st.entity.IndicatorSysDetail;
import nicg.st.entity.IndicatorTree;
import nicg.st.entity.InputParam;
import nicg.st.entity.LeafIndicator;
import nicg.st.entity.MyConfig;
import nicg.st.entity.SchemeList;
import nicg.st.entity.TaskDetail;
import nicg.st.entity.TaskInfos;
import nicg.st.entity.TaskVO;
import nicg.st.entity.TaskXDQD;
import nicg.st.entity.UnitXmlParseBean;
import nicg.st.entity.XDDetail;
import nicg.st.entity.battle.FightAbility;
import nicg.st.entity.battle.ZZNLVO;
import nicg.st.outerAPI.OuterInfo;
import nicg.st.service.UserService;
import nicg.st.service.generatereportservice.BaseReport;
import nicg.st.service.generatereportservice.Report33;
import nicg.st.service.generatereportservice.Report34;
import nicg.st.service.generatereportservice.Report35;
import nicg.st.service.generatereportservice.Report36;
import nicg.st.service.generatereportservice.Report63;
import nicg.st.service.generatereportservice.Report64;
import nicg.st.service.generatereportservice.Report65;
import nicg.st.service.generatereportservice.Report66;
import nicg.st.service.generatereportservice.Report67;
import nicg.st.service.generatereportservice.Report68;
import nicg.st.service.generatereportservice.Report69;
import nicg.st.util.ErrorCode;
import nicg.st.util.Log;
import nicg.st.util.ResponseUtil;
import nicg.st.util.UnitXmlParse;
import nicg.st.util.XmlParse;

/**
 * @author
 * @Description
 * @date 2019/11/3 22:35
 */
@Service
public class EvalDataEnterService {

	@Resource
	EvalDataEnterMapper evalDataEnterMapper;
	@Resource
	private MyConfig myConfig;
	public static int time = 0;
	@Resource
	UserService userService;

	// 根据用户信息获取用户级别（模拟接口）
	public int getUserLevel(int userId) {
		if (userId == 1) {
			// 旅一级
			return 1;
		} else {
			// 分队一级
			return 2;
		}
	}

	// 根据用户信息获取任务详情（模拟接口）
	public int getTask(int userId) {
		if (userId == 1) {
			// 主攻任务
			return 11;
		} else if (userId == 2) {
			// 地面攻击任务
			return 21;
		} else if (userId == 3) {
			// 空中突击任务
			return 23;
		} else if (userId == 4) {
			// 空中突击任务
			return 22;
		} else if (userId == 5) {
			// 空中突击任务
			return 24;
		} else if (userId == 6) {
			// 空中突击任务
			return 25;
		} else if (userId == 7) {
			// 空中突击任务
			return 26;
		} else if (userId == 8) {
			// 空中突击任务
			return 27;
		} else if (userId == 9) {
			// 空中突击任务
			return 28;
		} else if (userId == 10) {
			// 空中突击任务
			return 29;
		} else if (userId == 11) {
			// 空中突击任务
			return 30;
		} else {
			return 11;
		}
	}

	// 获取子分队
	public List<Integer> getChlidUnit(int upUserId) {
		int taskId = getTask(upUserId);
		List<Integer> childIds = new ArrayList<>();
		try {
			File f = new File("config/task-" + taskId + ".xml");
			SAXReader reader = new SAXReader();
			Document doc = reader.read(f);
			Element root = doc.getRootElement();
			Element foo;
			// 读取任务列表
			for (Iterator i = root.elementIterator("任务"); i.hasNext();) {
				foo = (Element) i.next();
				Element foo2;
				for (Iterator j = foo.elementIterator("子任务"); j.hasNext();) {
					foo2 = (Element) j.next();
				}
			}
			// 读取部队编成
			for (Iterator i = root.elementIterator("部队编成"); i.hasNext();) {
				foo = (Element) i.next();
				Element foo2;
				for (Iterator j = foo.elementIterator("分队"); j.hasNext();) {
					foo2 = (Element) j.next();
					Element foo3;
					for (Iterator k = foo2.elementIterator("子部队"); k.hasNext();) {
						foo3 = (Element) k.next();
						childIds.add(new Integer(foo3.getText()));
					}
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return childIds;
	}

	// 根据当前的身份信息获取任务信息
//	public String getInfos(int userId) {
//		List<TaskInfos> taskInfos = new ArrayList<TaskInfos>();
//		// 获取任务列表
//		int level = getUserLevel(userId);
//		// 如果是旅
//		if(level == 1){
//			List<TaskDetail> tasks = evalDataEnterMapper.getLVTasks();
//			for (TaskDetail t : tasks) {
//				List<IndicatorSys> indicators = evalDataEnterMapper.getTaskIndicators(userId, t.getRwlx());
//				List<XDDetail> xds = evalDataEnterMapper.getXDLists(t.getRwnm());
//				TaskInfos tf = new TaskInfos(t, indicators, xds);
//				taskInfos.add(tf);
//			}
//		}
//		// 如果是分队
//		else{
//			// pass
//		}
//
//		return ResponseUtil.getResponseString(ErrorCode.SUCCESSFUL, "successful", taskInfos);
//	}

	// 根据当前的身份信息获取任务信息
	public String getInfos(String userId) {
		String time1 = myConfig.getTime();
		List<TaskInfos> taskInfos = new ArrayList<TaskInfos>();
		List<TaskDetail> tasks = evalDataEnterMapper.getLVTasks();
		List<TaskDetail> rwqds = new ArrayList<>();

		for (TaskDetail task : tasks) {
			String startTime = task.getJhkssj();
			String endTime = task.getJhwcsj();

			String day = startTime.substring(0, 2);
			String month = startTime.substring(3, 5);
			String year = startTime.substring(6, 10);
			String hour = startTime.substring(11, startTime.length());
			startTime = year + month + day + hour;

			day = endTime.substring(0, 2);
			month = endTime.substring(3, 5);
			year = endTime.substring(6, 10);
			hour = endTime.substring(11, endTime.length());
			endTime = year + month + day + hour;
			if (time1.compareTo(startTime) >= 0 && endTime.compareTo(time1) >= 0) {
				rwqds.add(task);
			}
		}

		for (TaskDetail rwqd : rwqds) {
			List<IndicatorSys> indicators = evalDataEnterMapper.getTaskIndicators(userId, rwqd.getRwlx());
			Integer taskTypeId = evalDataEnterMapper.getTaskType(rwqd.getRwlx());
			rwqd.setRemark(indicators.get(0).getRemark());
			rwqd.setTaskTypeId(taskTypeId);
			List<XDDetail> xds = evalDataEnterMapper.getXDLists(rwqd.getRwnm());
			List<String> bdid = new ArrayList<>();
			if (xds != null) {
				for (XDDetail xd : xds) {
					String zxbdnm = xd.getZxbdnm();
					bdid.add(zxbdnm);
				}
			}
			TaskInfos tf = new TaskInfos(rwqd, indicators, xds, bdid);
			taskInfos.add(tf);
		}

		System.out.println(taskInfos);
		return ResponseUtil.getResponseString(ErrorCode.SUCCESSFUL, "successful", taskInfos);
	}

	/**
	 * 模拟获取指标数据（现为读XML文件）
	 */
	public List<LeafIndicator> getIndicatorData(int taskId) {
		time += 1;
		time %= 2;
		File file = new File("config/data-" + taskId + "-" + (time + 1) + ".xml");
		return XmlParse.getLeafIndicators(file);
	}

	/**
	 * @return java.lang.String
	 * @Description 构建树形指标体系结构-版本2.0
	 * @Date 2019/10/11 15:17
	 * @Param [indicatorId]
	 **/
	public String buildIndicatorTree(int userId, int indicatorId) {
		IndicatorSysDetail indicatorRoot = evalDataEnterMapper.getRootDetail(indicatorId);
		IndicatorTree treeRoot = new IndicatorTree(indicatorRoot.getId(), indicatorRoot.getIndicatorName(),
				indicatorRoot.getIndicatorPath(), indicatorRoot.getIndicatorLevel(), indicatorRoot.getRelativeWeight(),
				indicatorRoot.getAbsoluteWeight(), indicatorRoot.getRemark(), indicatorRoot.getParamId());

		// 逐层添加子节点
		LinkedList<IndicatorTree> queue = new LinkedList<>();
		queue.add(treeRoot);

		int inputParamIdSeq = 10000;// 给下面while循环中每个输入参数节点附上一个唯一的id，这里设置足够大保证不跟ZBTXMX的节点id冲突

		while (!queue.isEmpty()) {
			IndicatorTree nowRoot = queue.pop();
			List<IndicatorSysDetail> theseChildren = evalDataEnterMapper.getChildren(indicatorId, nowRoot.getName(),
					nowRoot.getLevel() + 1);
			List<IndicatorTree> treeChildren = new ArrayList<IndicatorTree>();
			if (theseChildren.isEmpty()) {
				List<InputParam> inputParams = evalDataEnterMapper.getInputParams(nowRoot.getId());
				List<IndicatorTree> nowRootTreeChildren = new ArrayList<IndicatorTree>();
				for (int i = 0; i < inputParams.size(); i++) {
					IndicatorTree tempNode = new IndicatorTree();
					tempNode.setName(inputParams.get(i).getParamName());
					tempNode.setId(inputParamIdSeq++);
					tempNode.setRemark(inputParams.get(i).getParamPrototype());
					tempNode.setPath(nowRoot.getPath() + "/" + inputParams.get(i).getParamName());
					tempNode.setLevel(nowRoot.getLevel() + 1);
					tempNode.setParamId(null);
					tempNode.setValue1(inputParams.get(i).getParamValue());

					// 设置最大值，需要去YSCSXX表中获取
					int paramMaxId = inputParams.get(i).getParamMaxId();
					double maxValue = evalDataEnterMapper.getMaxValueById(paramMaxId);
					tempNode.setMaxValue(maxValue);

					nowRootTreeChildren.add(tempNode);
				}

				nowRoot.setChildren(nowRootTreeChildren);

			}
			for (IndicatorSysDetail child : theseChildren) {
				IndicatorTree newChild = new IndicatorTree(child.getId(), child.getIndicatorName(),
						child.getIndicatorPath(), child.getIndicatorLevel(), child.getRelativeWeight(),
						child.getAbsoluteWeight(), child.getRemark(), child.getParamId());
				newChild.setValue1(0);
				newChild.setValue2(0);
				queue.add(newChild);
				treeChildren.add(newChild);
			}
			if (!treeChildren.isEmpty())
				nowRoot.setChildren(treeChildren);
		}
		IndicatorTree result = new IndicatorTree();
		result = treeRoot;
		return ResponseUtil.getResponseString(ErrorCode.SUCCESSFUL, "successful", result);
	}

	/**
	 * @return double
	 * @Description 递归计算每一级指标的评估得分
	 * @Date 2019/10/21 14:56
	 * @Param [itNode]
	 **/
	public double f(IndicatorTree itNode, EvalResult evalResult, List<Divate> divateList) {
		if (itNode.getChildren().get(0).getChildren() == null) {
			if (itNode.getName().equals("任务完成度")) {
				evalResult.setCompletion(get45De4(itNode.getValue2()));
			}
			if (itNode.getValue2() < 60 && itNode.getLevel() != 1) {
				List<String> list1 = evalResult.getDeviate();
				List<String> list2 = evalResult.getSolveDivate();
				for(Divate temp:divateList) {
					if(itNode.getName().equals(temp.getDivateName())) {
						list2.add("\"" + itNode.getName() + "\"：" + temp.getDivateDiscribe() + "，"
								+ temp.getDivateSolve());
					}
				}
				if (list2.size() != 0) {
					evalResult.setSolveDivate(list2);
					list1.add(itNode.getName());
					evalResult.setDeviate(list1);
				}
			}
			return itNode.getValue2();
		}
		double sum = 0;
		List<IndicatorTree> itClidren = itNode.getChildren();
		for (IndicatorTree it : itClidren) {
			sum += it.getRelativeWeight() * f(it, evalResult, divateList);
		}
		if (itNode.getName().equals("任务完成度")) {
			evalResult.setCompletion(get45De4(sum));
		}
		if (itNode.getName().equals("我方战损")) {
			evalResult.setDamage(get45De4(sum));
		}
		if (itNode.getName().equals("我方战果")) {
			evalResult.setConquest(get45De4(sum));
		}
		if (sum < 60 && itNode.getLevel() != 1 && itNode.getLevel() != 2) {
			List<String> list1 = evalResult.getDeviate();
			List<String> list2 = evalResult.getSolveDivate();
			for(Divate temp:divateList) {
				if(itNode.getName().equals(temp.getDivateName())) {
					list2.add("\"" + itNode.getName() + "\"：" + temp.getDivateDiscribe() + "，"
							+ temp.getDivateSolve());
				}
			}
			if (list2.size() != 0) {
				evalResult.setSolveDivate(list2);
				list1.add(itNode.getName());
				evalResult.setDeviate(list1);
			}
		}
		itNode.setValue2(sum);
		return sum;
	}

	/**
	 * @return java.lang.String
	 * @Description 指标数据的综合评估-版本10.11.3.0
	 * @Date 2019/6/27 10:26
	 * @Param [tempOpId]
	 **/
	public String eval2(EvalDataEnterVO evalDataEnterVO) {
		double sum = 0;
		// 评估 /////////////////////////////
		EvalResult evalResult = new EvalResult();
		List<String> divateList = new ArrayList<String>();
		List<String> solveDivateList = new ArrayList<String>();
		evalResult.setDeviate(divateList);
		evalResult.setSolveDivate(solveDivateList);
		// 构建AHP树
		EvalDataEnterVO e = evalDataEnterVO;
		Stack<IndicatorTree> stackIT = new Stack<>();
		Stack<nicg.st.entity.Node> stackN = new Stack<>();
		IndicatorTree it = e.getIndicatorTree();
		// 根据IndicatorTree构建新的符合评估要求的树形结构
		nicg.st.entity.Node nodeTree = new nicg.st.entity.Node();
		nodeTree.setWeight(1);
		stackIT.push(it);
		stackN.push(nodeTree);
		evalResult.setIndicatorName(it.getName());
		while (!stackIT.empty()) {
			IndicatorTree itNode = stackIT.pop();
			nicg.st.entity.Node nNode = stackN.pop();
			nNode.setName(itNode.getName());
			nNode.setWeight(nNode.getWeight() * itNode.getRelativeWeight());
			List<nicg.st.entity.Node> nodeList = new ArrayList<>();
			if (evalDataEnterMapper.getMethod(itNode.getId()) == null) {
				for (IndicatorTree child : itNode.getChildren()) {
					nicg.st.entity.Node tNode = new nicg.st.entity.Node();
					tNode.setWeight(nNode.getWeight());
					stackIT.push(child);
					stackN.push(tNode);
					nodeList.add(tNode);
				}
				nNode.setChild(nodeList);
			} else {
				// 通过该节点的叶节点计算该节点的数值
				// 获取公式的预设参数
//                List<EvalParamPO> evalParamPOs = evalDataEnterMapper.getParams(itNode.getId());
//                List<Double> params = new ArrayList<>();
//                for (EvalParamPO p : evalParamPOs) {
//					params.add(p.getParamValue());
//				}
				// 获取计算方法
//                int evalMetod = evalDataEnterMapper.getMethod(itNode.getId());
//                CalculateService calculateService = getObject(evalMetod, params, itNode);

				List<EvalParams> evalParams = evalDataEnterMapper.getEvalParams(itNode.getId());
				int method = evalDataEnterMapper.getMethod(itNode.getId());
				Calculation calculation = getCalculation(method, evalParams, itNode);

				// 加权求和
//                sum += nNode.getWeight() * calculateService.calculate();
//                itNode.setValue2(calculateService.calculate());
				sum += nNode.getWeight() * calculation.calculate();
				itNode.setValue2(calculation.calculate());
			}
		}
		System.out.println(sum);
		evalResult.setScore(new DecimalFormat("0.00").format(sum));
		// 计算每层指标的评估得分
		List<Divate> divateList1 = evalDataEnterMapper.getDivateList();
		f(it, evalResult, divateList1);

		// 写数据库 /////////////////////////////
		Date date = new Date();
		String name = e.getEvalName() + "+" + e.getTimes().toString();
		String tmpString = "";
		for (String str : evalResult.getDeviate()) {
			tmpString += str;
			tmpString += "/";
		}
		String report = getIndicatorReport(evalDataEnterVO.getIndicatorId(), evalResult, it, divateList1);
		evalResult.setReport(report);
		SchemeList schemeList = new SchemeList(name, e.getUserId(), date, sum, evalResult.getCompletion(), tmpString,
				evalResult.getDamage(), evalResult.getConquest(), report, "", evalDataEnterVO.getIndicatorId(),
				evalDataEnterVO.getTask().getRwnm());
		evalDataEnterMapper.setEvalScheme(schemeList);
		int schemeId = evalDataEnterMapper.getSchemeId(name, e.getUserId());
		evalResult.setId(schemeId);
		Stack<IndicatorTree> stackITDB = new Stack<>();
		stackITDB.push(it);
		while (!stackITDB.isEmpty()) {
			IndicatorTree node = stackITDB.pop();
			// 写数据库
			IndicatorDataDetail tmpIndicatorData = new IndicatorDataDetail(schemeId, e.getIndicatorId(), node.getName(),
					node.getPath(), node.getLevel(), node.getRelativeWeight(), node.getAbsoluteWeight(), 0.0,
					node.getValue1(), node.getValue2());
			try {
				evalDataEnterMapper.insertIndicatorData(tmpIndicatorData);
			} catch (Exception err) {
				System.out.println(err.toString());
			}
			if (node.getChildren() == null)
				continue;
			for (IndicatorTree itchild : node.getChildren()) {
				stackITDB.push(itchild);
			}
		}
		// 获取分队得分
		List<Integer> childrenIds = getChlidUnit(evalDataEnterVO.getUserId());
		if (!childrenIds.isEmpty()) {
			List<SchemeList> cScores = new ArrayList<SchemeList>();
			for (int cid : childrenIds) {
				int cUserLevel = getUserLevel(cid);
				int cTaskId = getTask(cid);
				int cIndicatorId = evalDataEnterMapper.getNowIndicatorId(cUserLevel, cTaskId);
				SchemeList cScheme = evalDataEnterMapper.getChildScore(cIndicatorId);
				cScores.add(cScheme);
//        		System.out.println(cScheme.getName());
			}
			evalResult.setChildrenScheme(cScores);
		}
		// 实时评估，每个一段时间评估一次
		Thread evalThread = new ThreadEval(evalDataEnterVO.getUserId(), evalDataEnterVO.getIndicatorId(),
				evalDataEnterVO.getEvalName(), evalDataEnterVO.getTimes(), evalDataEnterVO.getRemark(),
				evalDataEnterVO.getTask());
		evalThread.start();
		return ResponseUtil.getResponseString(ErrorCode.SUCCESSFUL, "successful", evalResult);
	}

	
	public String getIndicatorReport(int indicatorId, EvalResult evalResult, IndicatorTree itNode, List<Divate> divateList) {
		BaseReport report = null;
		
		switch(indicatorId) {
			case 33:
				report = new Report33();
				break;
			case 34:
				report = new Report34();
				break;
			case 35:
				report = new Report35();
				break;
			case 36:
				report = new Report36();
				break;
			case 63:
				report = new Report63();
				break;
			case 64:
				report = new Report64();
				break;
			case 65:
				report = new Report65();
				break;
			case 66:
				report = new Report66();
				break;
			case 67:
				report = new Report67();
				break;
			case 68:
				report = new Report68();
				break;
			case 69:
				report = new Report69();
				break;
		}
		
		return report.produceSelfReport(evalResult, itNode, divateList);
	}


	public Calculation getCalculation(int evalMethod, List<EvalParams> params, IndicatorTree itNode) {
		Calculation calculation;

		switch (evalMethod) {
		case 1:
			calculation = new Calculation01();
			if (itNode.getChildren() != null) {
				if ("n".equals(itNode.getChildren().get(0).getRemark())) {
					((Calculation01) calculation).setN(itNode.getChildren().get(0).getValue1());
				}

				// 下面三行代码是定义l，h，m，其中初始化值是随便写的，因为for循环是一定会对他们赋值的
				double l = 0;
				double h = 100;
				double m = 8000;

				for (int i = 0; i < params.size(); i++) {
					if ("l".equals(params.get(i).getParamPrototype())) {
						l = params.get(i).getParamValue();
					}
					if ("h".equals(params.get(i).getParamPrototype())) {
						h = params.get(i).getParamValue();
					}
					if ("m".equals(params.get(i).getParamPrototype())) {
						m = params.get(i).getParamValue();
					}
				}

				((Calculation01) calculation).setL(l);
				((Calculation01) calculation).setM(m);
				((Calculation01) calculation).setH(h);
			}
			break;
		case 2:
			calculation = new Calculation02();
			if (itNode.getChildren() != null) {
				if ("n".equals(itNode.getChildren().get(0).getRemark())) {
					((Calculation02) calculation).setN(itNode.getChildren().get(0).getValue1());
				}

				double m = 1;
				if ("m".equals(params.get(0).getParamPrototype())) {
					m = params.get(0).getParamValue();
				}

				((Calculation02) calculation).setM(m);
			}
			break;
		case 3:
			calculation = new Calculation03();
			if (itNode.getChildren() != null) {
				if ("n".equals(itNode.getChildren().get(0).getRemark())) {
					((Calculation03) calculation).setN(itNode.getChildren().get(0).getValue1());
				}

				double m = 1;
				if ("m".equals(params.get(0).getParamPrototype())) {
					m = params.get(0).getParamValue();
				}

				((Calculation03) calculation).setM(m);
			}
			break;
		case 10:
			calculation = new Calculation10();
			if (itNode.getChildren() != null) {

				if ("n".equals(itNode.getChildren().get(0).getRemark())) {
					((Calculation10) calculation).setN(itNode.getChildren().get(0).getValue1());
				}

				double m = 1;
				if ("m".equals(params.get(0).getParamPrototype())) {
					m = params.get(0).getParamValue();
				}

				((Calculation10) calculation).setM(m);
			}
			break;
		case 18:
			calculation = new Calculation18();
			if (itNode.getChildren() != null) {
				if ("n".equals(itNode.getChildren().get(0).getRemark())) {
					((Calculation18) calculation).setN(itNode.getChildren().get(0).getValue1());
				}

				double h = 1;
				double m = 1;

				for (int i = 0; i < params.size(); i++) {
					if ("h".equals(params.get(i).getParamPrototype())) {
						h = params.get(i).getParamValue();
					}
					if ("m".equals(params.get(i).getParamPrototype())) {
						m = params.get(i).getParamValue();
					}
				}

				((Calculation18) calculation).setH(h);
				((Calculation18) calculation).setM(m);
			}
			break;
		case 19:
			calculation = new Calculation19();
			if (itNode.getChildren() != null) {

				if ("n".equals(itNode.getChildren().get(0).getRemark())) {
					((Calculation19) calculation).setN(itNode.getChildren().get(0).getValue1());
				}
			}
			break;
		case 20:
			calculation = new Calculation20();
			if (itNode.getChildren() != null) {

				if ("n".equals(itNode.getChildren().get(0).getRemark())) {
					((Calculation20) calculation).setN(itNode.getChildren().get(0).getValue1());
				}

				// 下面三行代码是定义l，h，m，其中初始化值是随便写的，因为for循环是一定会对他们赋值的
				double l = 0;
				double h = 100;
				double m = 8000;

				for (int i = 0; i < params.size(); i++) {
					if ("l".equals(params.get(i).getParamPrototype())) {
						l = params.get(i).getParamValue();
					}
					if ("h".equals(params.get(i).getParamPrototype())) {
						h = params.get(i).getParamValue();
					}
					if ("m".equals(params.get(i).getParamPrototype())) {
						m = params.get(i).getParamValue();
					}
				}

				((Calculation20) calculation).setL(l);
				((Calculation20) calculation).setM(m);
				((Calculation20) calculation).setH(h);
			}
			break;
		case 22:
			calculation = new Calculation22();
			if (itNode.getChildren() != null) {

				if ("T".equals(itNode.getChildren().get(0).getRemark())) {
					((Calculation22) calculation).setT(itNode.getChildren().get(0).getValue1());
				}

				double T0 = 1;
				double t = 1;
				double at = 1;
				for (int i = 0; i < params.size(); i++) {
					if ("T0".equals(params.get(i).getParamPrototype())) {
						T0 = params.get(i).getParamValue();
					}
					if ("t".equals(params.get(i).getParamPrototype())) {
						t = params.get(i).getParamValue();
					}
					if ("at".equals(params.get(i).getParamPrototype())) {
						at = params.get(i).getParamValue();
					}
				}

				((Calculation22) calculation).setT0(T0);
				((Calculation22) calculation).setT(t);
				((Calculation22) calculation).setAt(at);
			}
			break;
		case 26:
			calculation = new Calculation26();
			if (itNode.getChildren() != null) {

				if ("n".equals(itNode.getChildren().get(0).getRemark())) {
					((Calculation26) calculation).setN(itNode.getChildren().get(0).getValue1());
				}

				double m = 1;

				if ("m".equals(params.get(0).getParamPrototype())) {
					m = params.get(0).getParamValue();
				}

				((Calculation26) calculation).setM(m);
			}
			break;
		default:
			calculation = new Calculation00();
			break;
		}

		return calculation;
	}

	public double get45De4(double sum) {
		BigDecimal b = new BigDecimal(sum);
		return b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
	}

	public String getScheme(String schemeName) {
		SchemeList schemeList = evalDataEnterMapper.getSchemeByName(schemeName);
		System.out.println(schemeList);
		return ResponseUtil.getResponseString(ErrorCode.SUCCESSFUL, "successful", schemeList);
	}

	public String getScheme2(String rwnm) {
		SchemeList schemeList = evalDataEnterMapper.getSchemeByRwnm(rwnm);
		System.out.println(schemeList);
		return ResponseUtil.getResponseString(ErrorCode.SUCCESSFUL, "successful", schemeList);
	}

	public String getSchemeOutside(String aramyName) {
		String name = aramyName.substring(0, 2);
		System.out.println(name);
		SchemeList schemeList = evalDataEnterMapper.getSchemeByName(name);
		System.out.println(schemeList);
		return ResponseUtil.getResponseString(ErrorCode.SUCCESSFUL, "successful", schemeList);
	}

	public String getTasks() {
		String time1 = "2020010102:05:00";
		List<TaskXDQD> tasks = evalDataEnterMapper.getTasks();
		List<TaskVO> res = new ArrayList<>();
		// 日-月-年 => 年-月-日
		for (TaskXDQD task : tasks) {
			String startTime = task.getJhkssj();
			String endTime = task.getJhwcsj();

			String day = startTime.substring(0, 2);
			String month = startTime.substring(3, 5);
			String year = startTime.substring(6, 10);
			String hour = startTime.substring(11, startTime.length());
			startTime = year + month + day + hour;

			day = endTime.substring(0, 2);
			month = endTime.substring(3, 5);
			year = endTime.substring(6, 10);
			hour = endTime.substring(11, endTime.length());
			endTime = year + month + day + hour;

			if (time1.compareTo(startTime) >= 0 && endTime.compareTo(time1) >= 0) {
				boolean flag = true;
				for (TaskVO taskRes : res) {
					if (taskRes.getRwnm().equals(task.getRwnm())) {
						flag = false;
						List<String> temp = taskRes.getZxbdmc();
						temp.add(task.getZxbdmc());
						taskRes.setZxbdmc(temp);
					}
				}
				if (flag) {
					TaskVO taskRes = new TaskVO();
					taskRes.setRwnm(task.getRwnm());
					List<String> temp = new ArrayList<String>();
					temp.add(task.getZxbdmc());
					taskRes.setZxbdmc(temp);
					res.add(taskRes);
				}
			}
		}

		System.out.println(res);
		return ResponseUtil.getResponseString(ErrorCode.SUCCESSFUL, "successful", res);
	}

	/**
	 * 方法描述：及时评估
	 * 
	 * @param userId
	 * @param indicatorId
	 * @return
	 */
//	public String justEval(String rwnm) {
//		EvalDataEnterVO evalDataEnterVO = new EvalDataEnterVO();
//
//		// 获取默认指标体系id
//		int indicatorId = -1;
//		String userId = userService.getCurUserId();
//		if(userId == null){
//			throw new GlobalException("获取当前用户ID失败！");
//		}
//		
//
//			String rwlx = evalDataEnterMapper.getRWLX(rwnm);
//			List<IndicatorSys> indicators = evalDataEnterMapper.getTaskIndicators(userId, rwlx);
//			for (IndicatorSys is : indicators) {
//				if (is.getCategory().equals("系统级")) {
//					indicatorId = is.getId();
//				}
//			}
//
//
//		// 构建数据结构和获取数据 /////////////////////////////
//		List<LeafIndicator> dataList = getIndicatorData(getTask(userId));
//		IndicatorSysDetail indicatorRoot = evalDataEnterMapper.getRootDetail(indicatorId);
//		String evalName = indicatorRoot.getIndicatorName() + "效果评估";
//		IndicatorTree treeRoot = new IndicatorTree(indicatorRoot.getId(), indicatorRoot.getIndicatorName(),
//				indicatorRoot.getIndicatorPath(), indicatorRoot.getIndicatorLevel(), indicatorRoot.getRelativeWeight(),
//				indicatorRoot.getAbsoluteWeight(), indicatorRoot.getRemark(), indicatorRoot.getParamId());
//		// 逐层添加子节点
//		LinkedList<IndicatorTree> queue = new LinkedList<>();
//		queue.add(treeRoot);
//
//		int inputParamIdSeq = 30000;// 给下面while循环中每个输入参数节点附上一个唯一的id，这里设置足够大保证不跟ZBTXMX的节点id冲突
//
//		while (!queue.isEmpty()) {
//			IndicatorTree nowRoot = queue.pop();
//			List<IndicatorSysDetail> theseChildren = evalDataEnterMapper.getChildren(indicatorId, nowRoot.getName(),
//					nowRoot.getLevel() + 1);
//			List<IndicatorTree> treeChildren = new ArrayList<IndicatorTree>();
//			if (theseChildren.isEmpty()) {
//
//				List<InputParam> inputParams = evalDataEnterMapper.getInputParams(nowRoot.getId());
//				List<IndicatorTree> nowRootTreeChildren = new ArrayList<IndicatorTree>();
//				for (int i = 0; i < inputParams.size(); i++) {
//					IndicatorTree tempNode = new IndicatorTree();
//					tempNode.setName(inputParams.get(i).getParamName());
//					tempNode.setId(inputParamIdSeq++);
//					tempNode.setRemark(inputParams.get(i).getParamPrototype());
//					tempNode.setPath(nowRoot.getPath() + "/" + inputParams.get(i).getParamName());
//					tempNode.setLevel(nowRoot.getLevel() + 1);
//					tempNode.setParamId(null);
//					tempNode.setValue1(inputParams.get(i).getParamValue());
//
//					// 设置最大值，需要去YSCSXX表中获取
//					int paramMaxId = inputParams.get(i).getParamMaxId();
//					double maxValue = evalDataEnterMapper.getMaxValueById(paramMaxId);
//					tempNode.setMaxValue(maxValue);
//
//					nowRootTreeChildren.add(tempNode);
//				}
//
//				nowRoot.setChildren(nowRootTreeChildren);
//			}
//			for (IndicatorSysDetail child : theseChildren) {
//				IndicatorTree newChild = new IndicatorTree(child.getId(), child.getIndicatorName(),
//						child.getIndicatorPath(), child.getIndicatorLevel(), child.getRelativeWeight(),
//						child.getAbsoluteWeight(), child.getRemark(), child.getParamId());
//				newChild.setValue1(0);
//				newChild.setValue2(0);
//				queue.add(newChild);
//				treeChildren.add(newChild);
//			}
//			if (!treeChildren.isEmpty())
//				nowRoot.setChildren(treeChildren);
//		}
//
//		// evalDataEnterVO
//		evalDataEnterVO.setUserId(userId);
//		evalDataEnterVO.setIndicatorId(indicatorId);
//		evalDataEnterVO.setEvalName(evalName);
//		evalDataEnterVO.setIndicatorTree(treeRoot);
//		evalDataEnterVO.setTimes(0);
//
//		// 评估 /////////////////////////////
//		double sum = 0;
//		EvalResult evalResult = new EvalResult();
//		List<String> divateList = new ArrayList<String>();
//		List<String> solveDivateList = new ArrayList<String>();
//		evalResult.setDeviate(divateList);
//		evalResult.setSolveDivate(solveDivateList);
//		// 构建AHP树
//		EvalDataEnterVO e = evalDataEnterVO;
//		Stack<IndicatorTree> stackIT = new Stack<>();
//		Stack<nicg.st.entity.Node> stackN = new Stack<>();
//		IndicatorTree it = e.getIndicatorTree();
//		// 根据IndicatorTree构建新的符合评估要求的树形结构
//		nicg.st.entity.Node nodeTree = new nicg.st.entity.Node();
//		nodeTree.setWeight(1);
//		stackIT.push(it);
//		stackN.push(nodeTree);
//		evalResult.setIndicatorName(it.getName());
//		while (!stackIT.empty()) {
//			IndicatorTree itNode = stackIT.pop();
//			nicg.st.entity.Node nNode = stackN.pop();
//			nNode.setName(itNode.getName());
//			nNode.setWeight(nNode.getWeight() * itNode.getRelativeWeight());
//			List<nicg.st.entity.Node> nodeList = new ArrayList<>();
//			if (evalDataEnterMapper.getMethod(itNode.getId()) == null) {
//				for (IndicatorTree child : itNode.getChildren()) {
//					nicg.st.entity.Node tNode = new nicg.st.entity.Node();
//					tNode.setWeight(nNode.getWeight());
//					stackIT.push(child);
//					stackN.push(tNode);
//					nodeList.add(tNode);
//				}
//				nNode.setChild(nodeList);
//			} else {
//				// 通过该节点的叶节点计算该节点的数值
//				// 获取公式的预设参数
////                List<EvalParamPO> evalParamPOs = evalDataEnterMapper.getParams(itNode.getId());
////                List<Double> params = new ArrayList<>();
////                for (EvalParamPO p : evalParamPOs) {
////					params.add(p.getParamValue());
////				}
//				// 获取计算方法
////                int evalMetod = evalDataEnterMapper.getMethod(itNode.getId());
////                CalculateService calculateService = getObject(evalMetod, params, itNode);
//
//				List<EvalParams> evalParams = evalDataEnterMapper.getEvalParams(itNode.getId());
//				int method = evalDataEnterMapper.getMethod(itNode.getId());
//				Calculation calculation = getCalculation(method, evalParams, itNode);
//
//				// 加权求和
////                sum += nNode.getWeight() * calculateService.calculate();
////                itNode.setValue2(calculateService.calculate());
//
//				sum += nNode.getWeight() * calculation.calculate();
//				itNode.setValue2(calculation.calculate());
//			}
//		}
//		System.out.println(sum);
//		evalResult.setScore(new DecimalFormat("0.00").format(sum));
//		// 计算每层指标的评估得分
//		setSolveMap();
//		getDivateMap();
//		f(it, evalResult);
//
//		// 写数据库 /////////////////////////////
//		Date date = new Date();
//		String name = e.getEvalName() + "+" + e.getTimes().toString();
//		String tmpString = "";
//		for (String str : evalResult.getDeviate()) {
//			tmpString += str;
//			tmpString += "/";
//		}
//		String report = generateReport(evalResult, it);
//		evalResult.setReport(report);
//		SchemeList schemeList = new SchemeList(name, e.getUserId(), date, sum, evalResult.getCompletion(), tmpString,
//				evalResult.getDamage(), evalResult.getConquest(), report, "", evalDataEnterVO.getIndicatorId(), rwnm);
//		evalDataEnterMapper.setEvalScheme(schemeList);
//		int schemeId = evalDataEnterMapper.getSchemeId(name, e.getUserId());
//		evalResult.setId(schemeId);
//		Stack<IndicatorTree> stackITDB = new Stack<>();
//		stackITDB.push(it);
//		while (!stackITDB.isEmpty()) {
//			IndicatorTree node = stackITDB.pop();
//			// 写数据库
//			IndicatorDataDetail tmpIndicatorData = new IndicatorDataDetail(schemeId, e.getIndicatorId(), node.getName(),
//					node.getPath(), node.getLevel(), node.getRelativeWeight(), node.getAbsoluteWeight(), 0.0,
//					node.getValue1(), node.getValue2());
//			try {
//				evalDataEnterMapper.insertIndicatorData(tmpIndicatorData);
//			} catch (Exception err) {
//				System.out.println(err.toString());
//			}
//			if (node.getChildren() == null)
//				continue;
//			for (IndicatorTree itchild : node.getChildren()) {
//				stackITDB.push(itchild);
//			}
//		}
//		// 获取分队得分
//		List<Integer> childrenIds = getChlidUnit(evalDataEnterVO.getUserId());
//		if (!childrenIds.isEmpty()) {
//			List<SchemeList> cScores = new ArrayList<SchemeList>();
//			for (int cid : childrenIds) {
//				int cUserLevel = getUserLevel(cid);
//				int cTaskId = getTask(cid);
//				int cIndicatorId = evalDataEnterMapper.getNowIndicatorId(cUserLevel, cTaskId);
//				SchemeList cScheme = evalDataEnterMapper.getChildScore(cIndicatorId);
//				cScores.add(cScheme);
//			}
//			evalResult.setChildrenScheme(cScores);
//		}
//		this.divateMap.clear();
//		this.solveMap.clear();
//
//		return ResponseUtil.getResponseString(ErrorCode.SUCCESSFUL, "successful", evalResult);
//	}

	public String getUnitXmlInformationList() {
		Log.printLog(this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName());
		List<UnitXmlParseBean> unitXmlParseList = UnitXmlParse.getParse(new File("unit.xml"));
		if (unitXmlParseList == null) {
			return ResponseUtil.getResponseString(ErrorCode.ERROR, "查询unit.xml文件信息错误，请联系系统管理员", "");
		} else {
			return ResponseUtil.getResponseString(ErrorCode.SUCCESSFUL, "查询成功", unitXmlParseList);
		}
	}

	/**
	 * 
	 * 类描述：定时评估功能 修改人： 修改日期： 修改内容： 版本号：1.0.0
	 */
	class ThreadEval extends Thread {
		private int userId;
		private int indicatorId;
		private String evalName;
		private int times;
		private String remark;
		private TaskDetail task;

		public ThreadEval(int userId, int indicatorId, String evalName, int times, String remark, TaskDetail task) {
			this.userId = userId;
			this.indicatorId = indicatorId;
			this.evalName = evalName;
			this.times = times;
			this.remark = remark;
			this.task = task;
		}

		@Override
		public void run() {
			while (true) {
				// 线程退出，条件：if currentTime == taskDetail.endTime
//	        	if(times == 3){
//	        		return;
//	        	}
				System.out.println(Thread.currentThread().getName());

				int delayTime = Integer.parseInt(myConfig.getIntervalTime());
				try {
					Thread.sleep(1000 * delayTime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}

				IndicatorSysDetail indicatorRoot = evalDataEnterMapper.getRootDetail(indicatorId);
				IndicatorTree treeRoot = new IndicatorTree(indicatorRoot.getId(), indicatorRoot.getIndicatorName(),
						indicatorRoot.getIndicatorPath(), indicatorRoot.getIndicatorLevel(),
						indicatorRoot.getRelativeWeight(), indicatorRoot.getAbsoluteWeight(), indicatorRoot.getRemark(),
						indicatorRoot.getParamId());
				// 逐层添加子节点
				LinkedList<IndicatorTree> queue = new LinkedList<>();
				queue.add(treeRoot);

				int inputParamIdSeq = 20000;// 给下面while循环中每个输入参数节点附上一个唯一的id，这里设置足够大保证不跟ZBTXMX的节点id冲突

				while (!queue.isEmpty()) {
					IndicatorTree nowRoot = queue.pop();
					List<IndicatorSysDetail> theseChildren = evalDataEnterMapper.getChildren(indicatorId,
							nowRoot.getName(), nowRoot.getLevel() + 1);
					List<IndicatorTree> treeChildren = new ArrayList<IndicatorTree>();
					if (theseChildren.isEmpty()) {
//	                	double value = 0;
//	                	double maxValue = 0;
//	                	for (LeafIndicator ldata : dataList) {
//	    					if(nowRoot.getName().equals(ldata.getName())){
//	    						value = ldata.getValue();
//	    						maxValue = ldata.getMax();
//	    					}
//	    				}
//	                	nowRoot.setValue1(value);
//	                	nowRoot.setMaxValue(maxValue);

						List<InputParam> inputParams = evalDataEnterMapper.getInputParams(nowRoot.getId());
						List<IndicatorTree> nowRootTreeChildren = new ArrayList<IndicatorTree>();
						for (int i = 0; i < inputParams.size(); i++) {
							IndicatorTree tempNode = new IndicatorTree();
							tempNode.setName(inputParams.get(i).getParamName());
							tempNode.setId(inputParamIdSeq++);
							tempNode.setRemark(inputParams.get(i).getParamPrototype());
							tempNode.setPath(nowRoot.getPath() + "/" + inputParams.get(i).getParamName());
							tempNode.setLevel(nowRoot.getLevel() + 1);
							tempNode.setParamId(null);
							tempNode.setValue1(inputParams.get(i).getParamValue());

							// 设置最大值，需要去YSCSXX表中获取
							int paramMaxId = inputParams.get(i).getParamMaxId();
							double maxValue = evalDataEnterMapper.getMaxValueById(paramMaxId);
							tempNode.setMaxValue(maxValue);

							nowRootTreeChildren.add(tempNode);
						}

						nowRoot.setChildren(nowRootTreeChildren);
					}
					for (IndicatorSysDetail child : theseChildren) {
						IndicatorTree newChild = new IndicatorTree(child.getId(), child.getIndicatorName(),
								child.getIndicatorPath(), child.getIndicatorLevel(), child.getRelativeWeight(),
								child.getAbsoluteWeight(), child.getRemark(), child.getParamId());
						newChild.setValue1(0);
						newChild.setValue2(0);
						queue.add(newChild);
						treeChildren.add(newChild);
					}
					if (!treeChildren.isEmpty())
						nowRoot.setChildren(treeChildren);
				}
				IndicatorTree result = new IndicatorTree();
				result = treeRoot;

				// 调用评估方法
				EvalDataEnterVO evalDataEnterVO = new EvalDataEnterVO();
				evalDataEnterVO.setUserId(userId);
				evalDataEnterVO.setIndicatorId(indicatorId);
				evalDataEnterVO.setEvalName(evalName);
				evalDataEnterVO.setTimes(++times);
				evalDataEnterVO.setRemark(remark);
				evalDataEnterVO.setIndicatorTree(treeRoot);
				evalDataEnterVO.setTask(task);
				eval(evalDataEnterVO);
			}
		}

		private void eval(EvalDataEnterVO evalDataEnterVO) {
			double sum = 0;
			// 评估 /////////////////////////////
			EvalResult evalResult = new EvalResult();
			List<String> divateList = new ArrayList<String>();
			List<String> solveDivateList = new ArrayList<String>();
			evalResult.setDeviate(divateList);
			evalResult.setSolveDivate(solveDivateList);
			// 构建AHP树
			EvalDataEnterVO e = evalDataEnterVO;
			Stack<IndicatorTree> stackIT = new Stack<>();
			Stack<nicg.st.entity.Node> stackN = new Stack<>();
			IndicatorTree it = e.getIndicatorTree();
			// 根据IndicatorTree构建新的符合评估要求的树形结构
			nicg.st.entity.Node nodeTree = new nicg.st.entity.Node();
			nodeTree.setWeight(1);
			stackIT.push(it);
			stackN.push(nodeTree);
			evalResult.setIndicatorName(it.getName());
			while (!stackIT.empty()) {
				IndicatorTree itNode = stackIT.pop();
				nicg.st.entity.Node nNode = stackN.pop();
				nNode.setName(itNode.getName());
				nNode.setWeight(nNode.getWeight() * itNode.getRelativeWeight());
				List<nicg.st.entity.Node> nodeList = new ArrayList<>();
				if (evalDataEnterMapper.getMethod(itNode.getId()) == null) {
					for (IndicatorTree child : itNode.getChildren()) {
						nicg.st.entity.Node tNode = new nicg.st.entity.Node();
						tNode.setWeight(nNode.getWeight());
						stackIT.push(child);
						stackN.push(tNode);
						nodeList.add(tNode);
					}
					nNode.setChild(nodeList);
				} else {
					// 通过该节点的叶节点计算该节点的数值
					// 获取公式的预设参数
//	                List<EvalParamPO> evalParamPOs = evalDataEnterMapper.getParams(itNode.getId());
//	                List<Double> params = new ArrayList<>();
//	                for (EvalParamPO p : evalParamPOs) {
//						params.add(p.getParamValue());
//					}
					// 获取计算方法
//	                int evalMetod = evalDataEnterMapper.getMethod(itNode.getId());
//	                CalculateService calculateService = getObject(evalMetod, params, itNode);

					List<EvalParams> evalParams = evalDataEnterMapper.getEvalParams(itNode.getId());
					int method = evalDataEnterMapper.getMethod(itNode.getId());
					Calculation calculation = getCalculation(method, evalParams, itNode);

					// 加权求和
//	                sum += nNode.getWeight() * calculateService.calculate();
//	                itNode.setValue2(calculateService.calculate());

					sum += nNode.getWeight() * calculation.calculate();
					itNode.setValue2(calculation.calculate());
				}
			}
			System.out.println("[多线程] " + sum);
			evalResult.setScore(new DecimalFormat("0.00").format(sum));
			// 计算每层指标的评估得分
			List<Divate> divateList3 = evalDataEnterMapper.getDivateList();
			f(it, evalResult, divateList3);

			// 写数据库 /////////////////////////////
			Date date = new Date();
			SimpleDateFormat sdFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
			String strDate = sdFormat.format(date);
			String name = e.getEvalName().split("-")[0] + "-" + strDate + "+" + e.getTimes().toString();
			String tmpString = "";
			for (String str : evalResult.getDeviate()) {
				tmpString += str;
				tmpString += "/";
			}
			String report = getIndicatorReport(evalDataEnterVO.getIndicatorId(), evalResult, it, divateList3);
			evalResult.setReport(report);
			SchemeList schemeList = new SchemeList(name, e.getUserId(), date, sum, evalResult.getCompletion(),
					tmpString, evalResult.getDamage(), evalResult.getConquest(), report, "",
					evalDataEnterVO.getIndicatorId(), evalDataEnterVO.getTask().getRwnm());
			evalDataEnterMapper.setEvalScheme(schemeList);
			int schemeId = evalDataEnterMapper.getSchemeId(name, e.getUserId());
			evalResult.setId(schemeId);
			Stack<IndicatorTree> stackITDB = new Stack<>();
			stackITDB.push(it);
			while (!stackITDB.isEmpty()) {
				IndicatorTree node = stackITDB.pop();
				// 写数据库
				IndicatorDataDetail tmpIndicatorData = new IndicatorDataDetail(schemeId, e.getIndicatorId(),
						node.getName(), node.getPath(), node.getLevel(), node.getRelativeWeight(),
						node.getAbsoluteWeight(), 0.0, node.getValue1(), node.getValue2());
				try {
					evalDataEnterMapper.insertIndicatorData(tmpIndicatorData);
				} catch (Exception err) {
					System.out.println(err.toString());
				}
				if (node.getChildren() == null)
					continue;
				for (IndicatorTree itchild : node.getChildren()) {
					stackITDB.push(itchild);
				}
			}
			// 获取分队得分
			List<Integer> childrenIds = getChlidUnit(evalDataEnterVO.getUserId());
			if (!childrenIds.isEmpty()) {
				List<SchemeList> cScores = new ArrayList<SchemeList>();
				for (int cid : childrenIds) {
					int cUserLevel = getUserLevel(cid);
					int cTaskId = getTask(cid);
					int cIndicatorId = evalDataEnterMapper.getNowIndicatorId(cUserLevel, cTaskId);
					SchemeList cScheme = evalDataEnterMapper.getChildScore(cIndicatorId);
					cScores.add(cScheme);
				}
				evalResult.setChildrenScheme(cScores);
			}
		}
	}

	public ZZNLVO getZZNL(String BDMC) {
		// TODO Auto-generated method stub
		FightAbility result = OuterInfo.getZZNL(myConfig.getZznlServerIp(), myConfig.getZznlServerPort(),
				myConfig.getZznlServerAPI());
		ZZNLVO zznl = new ZZNLVO();
		zznl.setDjnl(result.get打击力().get我打击力());
		zznl.setJdnl(result.get机动力().get我机动力());
		zznl.setBznl(result.get保障力().get我保障力());
		zznl.setFhnl(result.get防护力().get我防护力());
		zznl.setXxnl(result.get信息力().get我信息力());
		return zznl;
	}
}